package com.seanchenxi.gwt.wordpress.xmlrpc.service.local.impl;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.seanchenxi.gwt.wordpress.domain.model.Author;
import com.seanchenxi.gwt.wordpress.domain.model.Blog;
import com.seanchenxi.gwt.wordpress.domain.model.Category;
import com.seanchenxi.gwt.wordpress.domain.model.CategoryCreator;
import com.seanchenxi.gwt.wordpress.domain.model.Comment;
import com.seanchenxi.gwt.wordpress.domain.model.CommentCount;
import com.seanchenxi.gwt.wordpress.domain.model.CommentCreator;
import com.seanchenxi.gwt.wordpress.domain.model.CommentEditor;
import com.seanchenxi.gwt.wordpress.domain.model.CommentFinder;
import com.seanchenxi.gwt.wordpress.domain.model.FileData;
import com.seanchenxi.gwt.wordpress.domain.model.Options;
import com.seanchenxi.gwt.wordpress.domain.model.Page;
import com.seanchenxi.gwt.wordpress.domain.model.PageEditor;
import com.seanchenxi.gwt.wordpress.domain.model.PageList;
import com.seanchenxi.gwt.wordpress.domain.model.PageTemplate;
import com.seanchenxi.gwt.wordpress.domain.model.SimpleCategory;
import com.seanchenxi.gwt.wordpress.domain.model.Tag;
import com.seanchenxi.gwt.wordpress.domain.model.WpFile;
import com.seanchenxi.gwt.wordpress.xmlrpc.service.WordPressLocalServiceAsync;

/**
 * The Class WordPressLocalServiceAsyncImpl.
 */
public class WordPressLocalServiceAsyncImpl extends
		WordPressLocalServiceAsyncWrapper implements WordPressLocalServiceAsync {

	/**
	 * Instantiates a new word press local asynchronous service implementation.
	 * 
	 * @param url
	 *            the xmlrpc's url
	 * @param wpUserName
	 *            the wordpress's user name
	 * @param wpPassword
	 *            the wordpress's password
	 */
	public WordPressLocalServiceAsyncImpl(String url, String wpUserName,
			String wpPassword) {
		super(url, wpUserName, wpPassword);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getAuthors
	 * (int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getAuthors(int blogId, AsyncCallback<ArrayList<Author>> callback) {
		getWordPressService().getAuthors(blogId, getWpUserName(),
				getWpPassword(), callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getUsersBlogs
	 * (com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getUsersBlogs(AsyncCallback<ArrayList<Blog>> callback) {
		getWordPressService().getUsersBlogs(getWpUserName(), getWpPassword(),
				callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getPage
	 * (int, int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getPage(int blogId, int pageId, AsyncCallback<Page> callback) {
		getWordPressService().getPage(blogId, pageId, getWpUserName(),
				getWpPassword(), callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getPages
	 * (int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getPages(int blogId, AsyncCallback<ArrayList<Page>> callback) {
		getWordPressService().getPages(blogId, getWpUserName(),
				getWpPassword(), callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#newPage
	 * (int, com.seanchenxi.gwt.wordpress.domain.model.PageEditor, boolean,
	 * com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void newPage(int blogId, PageEditor content, boolean publish,
			AsyncCallback<Integer> callback) {
		getWordPressService().newPage(blogId, getWpUserName(), getWpPassword(),
				content, publish, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#deletePage
	 * (int, int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void deletePage(int blogId, int pageId,
			AsyncCallback<Boolean> callback) {
		getWordPressService().deletePage(blogId, getWpUserName(),
				getWpPassword(), pageId, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#editPage
	 * (int, int, com.seanchenxi.gwt.wordpress.domain.model.PageEditor,
	 * boolean, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void editPage(int blogId, int pageId, PageEditor content,
			boolean publish, AsyncCallback<Boolean> callback) {
		getWordPressService().editPage(blogId, pageId, getWpUserName(),
				getWpPassword(), content, publish, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getPageList
	 * (int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getPageList(int blogId,
			AsyncCallback<ArrayList<PageList>> callback) {
		getWordPressService().getPageList(blogId, getWpUserName(),
				getWpPassword(), callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getCategories
	 * (int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getCategories(int blogId,
			AsyncCallback<ArrayList<Category>> callback) {
		getWordPressService().getCategories(blogId, getWpUserName(),
				getWpPassword(), callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getTags
	 * (int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getTags(int blogId, AsyncCallback<ArrayList<Tag>> callback) {
		getWordPressService().getTags(blogId, getWpUserName(), getWpPassword(),
				callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#newCategory
	 * (int, com.seanchenxi.gwt.wordpress.domain.model.CategoryCreator,
	 * com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void newCategory(int blogId, CategoryCreator categoryCreator,
			AsyncCallback<Integer> callback) {
		getWordPressService().newCategory(blogId, getWpUserName(),
				getWpPassword(), categoryCreator, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#
	 * deleteCategory(int, int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void deleteCategory(int blogId, int categoryId,
			AsyncCallback<Boolean> callback) {
		getWordPressService().deleteCategory(blogId, getWpUserName(),
				getWpPassword(), categoryId, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#
	 * suggestCategories(int, java.lang.String, int,
	 * com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void suggestCategories(int blogId, String category, int max_results,
			AsyncCallback<ArrayList<SimpleCategory>> callback) {
		getWordPressService().suggestCategories(blogId, getWpUserName(),
				getWpPassword(), category, max_results, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#uploadFile
	 * (int, com.seanchenxi.gwt.wordpress.domain.model.FileData,
	 * com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void uploadFile(int blogId, FileData data,
			AsyncCallback<WpFile> callback) {
		getWordPressService().uploadFile(blogId, getWpUserName(),
				getWpPassword(), data, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#
	 * getCommentCount(int, java.lang.String,
	 * com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getCommentCount(int blogId, String postId,
			AsyncCallback<ArrayList<CommentCount>> callback) {
		getWordPressService().getCommentCount(blogId, getWpUserName(),
				getWpPassword(), postId, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#
	 * getPostStatusList(int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getPostStatusList(int blogId,
			AsyncCallback<ArrayList<String>> callback) {
		getWordPressService().getPostStatusList(blogId, getWpUserName(),
				getWpPassword(), callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#
	 * getPageStatusList(int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getPageStatusList(int blogId,
			AsyncCallback<ArrayList<String>> callback) {
		getWordPressService().getPageStatusList(blogId, getWpUserName(),
				getWpPassword(), callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#
	 * getPageTemplates(int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getPageTemplates(int blogId,
			AsyncCallback<ArrayList<PageTemplate>> callback) {
		getWordPressService().getPageTemplates(blogId, getWpUserName(),
				getWpPassword(), callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getOptions
	 * (int, java.util.ArrayList, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getOptions(int blogId, ArrayList<String> optionNames,
			AsyncCallback<ArrayList<Options>> callback) {
		getWordPressService().getOptions(blogId, getWpUserName(),
				getWpPassword(), optionNames, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#setOptions
	 * (int, java.util.ArrayList, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void setOptions(int blogId, ArrayList<Options> options,
			AsyncCallback<ArrayList<Options>> callback) {
		getWordPressService().setOptions(blogId, getWpUserName(),
				getWpPassword(), options, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getComment
	 * (int, int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getComment(int blogId, int commentId,
			AsyncCallback<Comment> callback) {
		getWordPressService().getComment(blogId, getWpUserName(),
				getWpPassword(), commentId, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#getComments
	 * (int, com.seanchenxi.gwt.wordpress.domain.model.CommentFinder,
	 * com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getComments(int blogId, CommentFinder commentFinder,
			AsyncCallback<ArrayList<Comment>> callback) {
		getWordPressService().getComments(blogId, getWpUserName(),
				getWpPassword(), commentFinder, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#deleteComment
	 * (int, int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void deleteComment(int blogId, int commentId,
			AsyncCallback<Boolean> callback) {
		getWordPressService().deleteComment(blogId, getWpUserName(),
				getWpPassword(), commentId, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#editComment
	 * (int, int, com.seanchenxi.gwt.wordpress.domain.model.CommentEditor,
	 * com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void editComment(int blogId, int commentId,
			CommentEditor commentEditor, AsyncCallback<Boolean> callback) {
		getWordPressService().editComment(blogId, getWpUserName(),
				getWpPassword(), commentId, commentEditor, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#newComment
	 * (int, int, com.seanchenxi.gwt.wordpress.domain.model.CommentCreator,
	 * com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void newComment(int blogId, int postId,
			CommentCreator commentCreator, AsyncCallback<Integer> callback) {
		getWordPressService().newComment(blogId, getWpUserName(),
				getWpPassword(), postId, commentCreator, callback);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.seanchenxi.gwt.wordpress.service.WordPressLocalServiceAsync#
	 * getCommentStatusList(int, com.google.gwt.user.client.rpc.AsyncCallback)
	 */
	@Override
	public void getCommentStatusList(int blogId,
			AsyncCallback<ArrayList<String>> callback) {
		getWordPressService().getCommentStatusList(blogId, getWpUserName(),
				getWpPassword(), callback);
	}
}
